import java.util.Scanner;

/**
 * 10. 纸张尺寸
 * https://www.lanqiao.cn/problems/2120/learning/?page=1&first_category_id=1&tags=2022,%E7%9C%81%E8%B5%9B&tag_relation=intersection&sort=pass_rate&asc=0
 */
public class Main9 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        String str = scan.next();
        int l = 1189;
        int w = 841;
        char[] ch = str.toCharArray();
        for(int i = 0; i < Integer.parseInt(ch[1] + "");i++) {
            int tmp = l / 2;
            l = w;
            w = tmp;
        }
        System.out.println(l);
        System.out.println(w);
        scan.close();
    }
}
